package Testwork;

public class PersonTest {

	public static void main(String[] args) {
		Person[] peoples = new Person[4];
		
		peoples[0] = new Employee("zhang", "136", "1360", "1360@mail.com", 21, "female", 1000.0);
		peoples[1] = new Student("wang", "110", "15959", "15959@163.com", 18, "male", "1");
		peoples[2] = new Programmer("Gates", "usa", "911", "911@com", 59, "male", 100000.0, 50000.0);
		peoples[3] = new Manager("Clark", "GE", "111", "111@mail.com", 10, "mail", 90000.1, 12000.3);
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < 3; j++)
				if (peoples[j].getAge() > peoples[j + 1].getAge()) {
					Person temp = peoples[j];
					peoples[j] = peoples[j + 1];
					peoples[j + 1] = temp;
				}
		}
		for (Person person : peoples) {
			System.out.println(person);
		}
		
	}
}
